﻿using JYB.SummitExam.DAL;
using JYB.SummitExam.IDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Factory {
	public class objectFactory {
		public static IUserDAL CreateIUserDAL(UserType type) {
			IUserDAL iud = null;
			switch (type) {
				case UserType.SystemStudents:
					iud = new StudentsDAL();
					break;
				case UserType.SystemTeacher:
					iud = new TeacherDAL();
					break;
				default:
					throw new Exception("wrong Usertype");
			}
			return iud;
		}

		public enum UserType {
			SystemStudents,
			SystemTeacher
		}
	}
}
